food city man loveUbuntu 

How to install Jenkins in Ubuntu/Linux

Jenkins is an open-source automation server. Continuous integration and continuous delivery are made possible by automating the software development processes of developing, testing, and deploying. It is a server-based program that runs on Apache Tomcat or another servlet container.

Prerequisites:

  • A server or virtual machine running Ubuntu Linux (or another Linux distribution of your choice).
  • SSH access to the server with sudo privileges
  • Basic knowledge of using the command line

Here’s a step-by-step guide to installing Jenkins:

  1. Update the repository for packages:
  • Use SSH to connect to your server.
  • To make sure you’re dealing with the most recent package information, update the package repository:
sudo apt update
  1. Install Java:
  • Because Jenkins is written in Java, the Java Runtime Environment (JRE) must be installed on your server. OpenJDK is widely employed.
sudo apt install openjdk-11-jre

#verify java instllation

java -version

  1. Add Jenkins Repository and Key:
  • Jenkins offers an official Ubuntu repository. Include the Jenkins repository key and URL for the repository:
wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
  • Add the Jenkins repository:
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
  1. Install Jenkins:
  • Update the package list, then set up Jenkins:
sudo apt update
sudo apt install jenkins

Jenkins installation is complete in Linux/Ubuntu

  1. Start and Enable Jenkins:
  • Launch the Jenkins service and make it boot-up-ready:
sudo systemctl start jenkins
sudo systemctl enable jenkins
  1. Open the firewall port, if necessary:
  • Open port 8080 on your server’s firewall (such as the UFW) to permit outside access to Jenkins:
sudo ufw allow 8080
  1. Launch the Jenkins Web Interface:
  • Navigate to your server’s IP address or domain followed by port 8080 (http://your_server_ip_or_domain:8080/) in a web browser.
  • Jenkins will be asked to be unlocked. Retrieve your server’s initial admin password:
sudo cat /var/lib/jenkins/secrets/initialAdminPassword

#Copy the password and paste it into the Jenkins web interface to unlock Jenkins.
  1. Install Recommended Plugins:
  • During setup, select the “Install suggested plugins” option. The most widely used Jenkins plugins will be installed.
  1. Create an Administrator User:
  • To create an admin user for Jenkins, follow the on-screen steps.
  1. Setup Jenkins:
  • Configure Jenkins according to your specific environment and requirements. This involves specifying the Jenkins URL and, if required, configuring email notifications.
  • Begin Using Jenkins: You can now begin automating your CI/CD operations by establishing jobs and pipelines in Jenkins.
Also Read:  How to host Codeigniter 4 Via Jenkins CICD Pipeline.

That’s all! Jenkins has been installed successfully on your Ubuntu server. You may use your web browser to access Jenkins and begin configuring your CI/CD pipelines and tasks to automate your development processes.

Related posts